<?php include_partial('genericComponent/rightTitle', array('title' => 'Evénements - Infos')); ?>

<ul id="events">
    <?php foreach($events_list as $event) { ?>
    <li>
        <a href="<?php echo url_for(array('module' => 'event', 'action' => 'index', 'year' => date("Y", strtotime($event['datetime_event'])), 'month' => date("m", strtotime($event['datetime_event'])), 'title_slug' => $event->getTitleSlug())) ?>">
            <span class="date">&#187; <?php echo date("d/m/Y", strtotime($event['datetime_event'])) ?></span>
            <?php $validityTimePost = strtotime($event['updated_at']) + 5*24*60*60; ?>
            <?php $isValid = time() < $validityTimePost ? true : false ?>
            <?php if($isValid): ?>
                <span class="new">Nouveau !</span>
            <?php endif; ?>
            <span class="title"><?php echo $event['title'] ?></span>
        </a>
    </li>
    <?php } ?>
</ul>
<p class="link_all_events">Retrouvez l'historique <?php echo link_to('des événements/infos de CPF Aizenay', '@events_all') ?></p>